package com.platform.usercenter.utils;

import com.platform.common.core.utils.StringUtils;

public class HashCodeUtil {

    public static void main(String[] args) {
        String code="$2a$10$Snw7RDjTtPMyjHrLVwhBh.BO7W/8CpiCilg8Y5CpMgHkajg/o.YDG";
        System.out.println("code.hashCode() = " + code.hashCode());
    }

    /***
     * 取字符串Hashcode
     * @param str
     * @return
     */
    public static String getHashCodeStr(String str){
        if(StringUtils.isEmpty(str)){
            return null;
        }
        return str.hashCode()+"";
    }

    public static int getHashCode(String str){
        return str.hashCode();
    }
}
